package com.google.code.mergeinformer.config;

import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions;
import org.tmatesoft.svn.core.wc.ISVNOptions;
import org.tmatesoft.svn.core.wc.SVNClientManager;

/**
 * @author Dmitry Golubev
 */
public class SvnClientManagerFactory {

    private final ISVNOptions defaultOptions = new DefaultSVNOptions();
    private final ISVNAuthenticationManager anonymousAuthManager = new BasicAuthenticationManager(null, null);

    public SVNClientManager getInstance() {
        return SVNClientManager.newInstance(defaultOptions, anonymousAuthManager);
    }

    public SVNClientManager getInstance(String username, String password) {
        return SVNClientManager.newInstance(defaultOptions, new BasicAuthenticationManager(username, password));
    }
}
